package com.ruixiang.study;

import java.util.ArrayList;
import java.util.List;

/**
 * @author ruixinag
 * @description
 * @create Created in 2022/1/18 15:10
 */
public class Demo2 {

    public static void main(String[] args) {
        Bean bean = new Bean();
        ArrayList<String> arrayList = new ArrayList<>();
        arrayList.add("aaa");
        bean.setList(arrayList);
        List list = bean.getList();
        list.add("hello");
        list.add("hello");
        list.add("hello");

        System.out.println(bean);
    }
}

class Bean {
    private String name;
    private int age;
    private List<String> list;

    public String getName() {
        return name;

    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public List getList() {
        return list;
    }

    public void setList(List list) {
        this.list = list;
    }

    @Override
    public String toString() {
        return "Bean{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", list=" + list +
                '}';
    }
}
